package com.yami.shop.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.yami.shop.bean.model.StockChangeReason;
import com.yami.shop.common.util.PageParam;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 *
 *
 * @author LGH
 * @date 2021-09-07 16:04:18
 */
public interface StockChangeReasonMapper extends BaseMapper<StockChangeReason> {

    /**
     * 分页查询出入库原因
     * @param page
     * @param stockChangeReason
     * @return
     */
    IPage<StockChangeReason> pageByParams(@Param("page") PageParam<StockChangeReason> page, @Param("stockChangeReason") StockChangeReason stockChangeReason);

    /**
     * 获取出入库原因列表
     * @param stockChangeReason
     * @return
     */
    List<StockChangeReason> listByParams(@Param("stockChangeReason") StockChangeReason stockChangeReason);

    /**
     * 获取名称数量
     * @param stockChangeReason
     * @return
     */
    int countByParams(@Param("stockChangeReason") StockChangeReason stockChangeReason);

    /**
     * 根据主键id与店铺id获取出入库原因信息
     * @param stockChangeReasonId
     * @param shopId
     * @return
     */
    StockChangeReason getInfoByIdAndShopId(@Param("stockChangeReasonId") Long stockChangeReasonId, @Param("shopId") Long shopId);
}
